# 定义源文件（根据实际情况调整）
SRC_FILE = momoisay.c art/art.c

# Debug 构建：开启 debug_mode
build-debug: gen
	# 将 debug_mode 设为 true
	sed -i 's/bool debug_mode = false;/bool debug_mode = true;/' $(SRC_FILE)
	# 编译时添加调试符号 (-g)
	cc $(SRC_FILE) -lmpg123 -lncursesw -lasound -lpthread -g -Wall -Wextra -o momoisay-debug

# Release 构建：关闭 debug_mode
build-release: gen
	# 确保 debug_mode 设为 false
	sed -i 's/bool debug_mode = true;/bool debug_mode = false;/' $(SRC_FILE)
	# 编译时添加优化 (-O2)
	cc $(SRC_FILE) -lmpg123 -lncursesw -lasound -lpthread -O2 -Wall -Wextra -o momoisay

# 测试目标分别对应 Debug/Release 版本
test-momoisay-debug: build-debug
	./momoisay-debug

test-momoisay-release: build-release
	./momoisay

gen:
	make -C assets
	mv assets/*.h .

test-sound:
	-aplay /usr/share/sounds/alsa/Front_Center.wav

test-ffplay:
	-cc ffplay_test.c && ./a.out

clean:
	rm *.h momoisay momoisay-debug a.out
